﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://itcast.cn/common/"  prefix="it" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<TITLE>客户列表</TITLE> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<LINK href="${pageContext.request.contextPath }/css/Style.css" type=text/css rel=stylesheet>
<LINK href="${pageContext.request.contextPath }/css/Manage.css" type=text/css
	rel=stylesheet>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.4.4.min.js"></script>
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css" type=text/css rel="stylesheet">
<script type="text/javascript">
	function deleteUser(userId) {
		if(confirm('确实要删除该客户吗?')) {
			$.post("${pageContext.request.contextPath}/deleteUser.action",
					{"userId":userId},
					function(data){
						alert("客户删除更新成功！");
						window.location.reload();
			});
		}
	}
/* 	function updateUser(userId) {
		$.post("${pageContext.request.contextPath}/toUpdateUser.action",
				{"userId":userId},
				function(data){
		});
	} */
</script>
<style type="text/css">
	#sButton2{
		width:70px;
		height: 21px;
        line-height: 21px;
        padding: 0 11px;
        background: #02bafa;
        border: 1px #26bbdb solid;
        border-radius: 3px;
        color: #fff;
        display: inline-block;
        text-decoration: none;
        font-size: 12px;
        outline: none
	}
</style>
<META content="MSHTML 6.00.2900.3492" name=GENERATOR>
</HEAD>
<BODY>
		<TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
			<TBODY>
				<TR>
					<TD width=15><IMG src="${pageContext.request.contextPath }/images/new_019.jpg"
						border=0></TD>
					<TD width="100%" background="${pageContext.request.contextPath }/images/new_020.jpg"
						height=20></TD>
					<TD width=15><IMG src="${pageContext.request.contextPath }/images/new_021.jpg"
						border=0></TD>
				</TR>
			</TBODY>
		</TABLE>
	<FORM id="customerForm" name="customerForm" action="${pageContext.request.contextPath }/userList.action" method=post>
		<TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
			<TBODY>
				<TR>
					<TD width=15 background=${pageContext.request.contextPath }/images/new_022.jpg><IMG
						src="${pageContext.request.contextPath }/images/new_022.jpg" border=0></TD>
					<TD vAlign=top width="100%" bgColor=#ffffff>
						<TABLE cellSpacing=0 cellPadding=5 width="100%" border=0>
							<TR>
								<TD class=manageHead>当前位置：用户管理 &gt; 用户列表</TD>
							</TR>
							<TR>
								<TD height=2></TD>
							</TR>
						</TABLE>
						<TABLE borderColor=#cccccc cellSpacing=0 cellPadding=0
							width="100%" align=center border=0>
							<TBODY>
								<TR>
									<TD height=25>
										<TABLE cellSpacing=0 cellPadding=2 border=0>
											<TBODY>
												<TR>
														<TD>账号：</TD>
														<TD>
															<INPUT class=textbox id=sChannel2  maxLength=50 name="userNum" value="${userNum}">
														</TD>
														<TD>&nbsp;&nbsp;部门：</TD>
														<TD>
															<select name="departmentId">
																<option value="">-请选择-</option>
																<c:forEach items="${departmentList}" var="department">
																	<option value="${department.departmentId}"<c:if test="${department.departmentId == departmentId}"> selected</c:if>>
	 																			${department.departmentName}
	 																</option>
																</c:forEach>
															</select>
														</TD>
														<TD>&nbsp;&nbsp;角色：</TD>
														<TD>
															<select name="roleId" >
																<option value="" >-请选择-</option>
																<c:forEach items="${roleList}" var="role">
																	<option value="${role.roleId}" <c:if test="${role.roleId == roleId}">selected</c:if>>
																		${role.roleName}
																	</option>
																</c:forEach>
															</select>
														</TD>
														<TD>&nbsp;&nbsp;姓名：</TD>
														<TD>
															<INPUT class=textbox id=sChannel2  maxLength=50 name="userName" value="${userName}">
														</TD>
														<TD>
															&nbsp;<INPUT id=sButton2 type=submit value=" 筛选 " name=sButton2>
														</TD>
														<TD>
															&nbsp;&nbsp;
															<c:if test="${loginUserAoth['1'].getIsChecked()==1}">
																<a id=sButton2 style="text-decoration:none" href="${pageContext.request.contextPath }/toUserAdd.action">
																	&nbsp;添加
																</a>
															</c:if>
														</TD>
												</TR>
											</TBODY>
										</TABLE>
									</TD>
								</TR>
							    
								<TR>
									<TD>
										<TABLE id=grid style="BORDER-TOP-WIDTH: 0px; FONT-WEIGHT: normal; 
																BORDER-LEFT-WIDTH: 0px; BORDER-LEFT-COLOR: #cccccc;
																BORDER-BOTTOM-WIDTH: 0px; BORDER-BOTTOM-COLOR: #cccccc; WIDTH: 100%; 
																BORDER-TOP-COLOR: #cccccc; FONT-STYLE: normal; BACKGROUND-COLOR: #cccccc ; 
																BORDER-RIGHT-WIDTH: 0px; text-DECORATION: none; BORDER-RIGHT-COLOR: #cccccc"
										cellSpacing=1 cellPadding=2 rules=all border=0>
											<TBODY>
												<TR style="FONT-WEIGHT: bold; FONT-STYLE: normal; BACKGROUND-COLOR: #eeeeee; TEXT-DECORATION: none">
													<TD>账号</TD>
													<TD>姓名</TD>
													<TD>角色</TD>
													<TD>部门</TD>
													<TD>电话</TD>
													<TD>地址</TD>
													<TD>邮箱</TD>
													<TD>操作</TD>
												</TR>
												<c:forEach items="${page.rows}" var="user">
													<TR style="FONT-WEIGHT: normal; FONT-STYLE: normal; BACKGROUND-COLOR: white; TEXT-DECORATION: none">
														<TD>${user.userNum}</TD>
														<TD>${user.userName}</TD>
														<TD>${user.roleName}</TD>
														<TD>${user.departmentName}</TD>
														<TD>${user.userPhone}</TD>
														<TD>${user.userAddress}</TD>
														<TD>${user.userEmail}</TD>
														<TD>
														<c:if test="${loginUserAoth['2'].getIsChecked()==1}">
															<a href="${pageContext.request.contextPath}/toUpdateUser.action?userId=${user.userId }">修改</a>
														</c:if>
														<c:if test="${loginUserAoth['3'].getIsChecked()==1}">
															&nbsp;&nbsp;
															<a href="#" onclick="deleteUser(${user.userId})">删除</a>
														</c:if>
														</TD>
													</TR>
												</c:forEach>
											</TBODY>
										</TABLE>
									</TD>
								</TR>
								
								<TR>
									<TD>
									<SPAN id=pagelink>
											
											<div class="col-md-12 text-right"> 
												<it:page url="${pageContext.request.contextPath }/userList.action" /> 
											</div>
									</SPAN>
								</TD>
								</TR>
							</TBODY>
						</TABLE>
					</TD>
					<TD width=15 background="${pageContext.request.contextPath }/images/new_023.jpg">
					<IMG src="${pageContext.request.contextPath }/images/new_023.jpg" border=0></TD>
				</TR>
			</TBODY>
		</TABLE>
	</FORM>
		<TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
			<TBODY>
				<TR>
					<TD width=15><IMG src="${pageContext.request.contextPath }/images/new_024.jpg"
						border=0></TD>
					<TD align=middle width="100%"
						background="${pageContext.request.contextPath }/images/new_025.jpg" height=15></TD>
					<TD width=15><IMG src="${pageContext.request.contextPath }/images/new_026.jpg"
						border=0></TD>
				</TR>
			</TBODY>
		</TABLE>
</BODY>
</HTML>
